home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-14 | 2.6 KB | 95 lines | [TEXT/MPS ] |
- /* _________________________________________________________________________________________________________ //
- Copyright © 1992 Apple Computer, Inc. All rights reserved.
- Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
- Programmer: Kent Sandvik
- Date: 9/26/92
- Revision comments are at the end of this file.
- ---
- TUserTermination is a command dot tracking class, used for finding out if the end user wants to stop
- an action. Most of the code is based on earlier snippet by Dave Radcliffe/DTS.
- TUserTermination.h contains the header file information for the TUserTermination class.
- _________________________________________________________________________________________________________ */
-
- // Declare label for this header file
- #ifndef _USERTERMINATION_
- #define _USERTERMINATION_
-
- #ifndef _DTSCPLUSLIBRARY_
- #include "DTSCPlusLibrary.h"
- #endif
-
- #ifndef __SCRIPT__
- #include <Script.h>
- #endif
-
- #ifndef __EVENTS__
- #include <Events.h>
- #endif
-
- #ifndef __RESOURCES__
- #include <Resources.h>
- #endif
-
- #ifndef __OSEVENTS__
- #include <OSEvents.h>
- #endif
-
- #ifndef __GESTALTEQU__
- #include <GestaltEqu.h>
- #endif
-
-
- // Inline definitions
- pascal long AUXDispatch(short selector,
- char* p) = {
- 0xABF9};
-
-
- // _________________________________________________________________________________________________________ //
- // Class Interface
-
- class TUserTermination
- // TUserTermination is a simple event checking class, that tries to find out when the end user
- // has pressed a '.' and a command key, or another combination reminding of a termination
- // (such as command-q, even if command-. is the official Apple User Interface way of doing things.
- {
- public:
- // ENUMS AND TYPEDEFS
- enum EConstant
- {
- kAUXFindEvent = 8, ktAscii2Mask = 0x000000FF, ktAscii1Mask = 0x00FF0000
- };
-
- // CONSTRUCTORS AND DESTRUCTORS
- TUserTermination(char ASCIIValue = '.'); // Note dot ('.') as the default ascii char
- virtual~ TUserTermination();
-
- // INITIALIZATION ROUTINES
- virtual void Initialize();
-
- // MAIN INTERFACE
- virtual Boolean Abort(); // main function
-
- // PRIVATE INTERNAL FUNCTIONS
- virtual Boolean CheckAUXEventQueue(char keyCode,
- short modifiers);
- // FIELDS
- protected:
- char fChar; // our initial key value
- char fKeyCode; // the key value translated to a virtual code char
- Boolean fAUX; // do we run under A/UX or not (different event handling)
- };
-
- #endif
-
- // _________________________________________________________________________________________________________ //
-
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 9/26/92 New file
- */
-
-
-
-